We recreated the video game Dance Dance Revolution (DDR) using the Raspberry Pi. DDR is a rhythm game where the player uses their feet to press on four pressure pads when prompted by the game screen. The player earns points by pressing the appropriate pad in rhythm with the song. We will create a dance platform that inputs pressure pad presses to the Raspberry Pi and outputs colors using displays LEDs on the top and bottom of the platform. The Raspberry Pi processes user input presses, determine the player’s score, and displays a game window to prompt the user to press the pressure pads, display the score, and navigate menus. The software of the game was programmed in Python using Pygame.
We thoroughly describe our hardware and software design methodologies and implementations on their respective pages (Hardware Design, Software Design). We had problems with the timing aspect of the game. We were able to use the level editor to solve this problem. Also, some of the button pads moved as the player pressed down on them. We fixed this issue by duct taping the tops of them.
We performed the follwing tests for the hardware:
We performed the majority of the software testing without using the physical dance pad. We used the Raspberry Pi and mapped its onboard buttons to the pressure pad inputs. This made testing easier and faster.
First, we tested if we had implemented software-side debouncing correctly. We experimented with pressing buttons
sequentially at different rates and varied which buttons we pressed. We also varied how long we held the button
down to ensure only one input press was detected for longer presses.
Next, we verified the screen transitions. We tried navigating through every possible screen pattern and verified that we
could also go backwards (ex: from the song select screen back to the main menu screen). We wanted to make sure that all
the data was passed correctly between screens.
Next, we tested the functionality of individual screens. We started with the select screen and verified that we could select
every song and that the correct song played during the game. Then we tested both difficulties and made sure the correct background
was displayed during the game. We spent the majority of the time testing the actual gameplay. We tried different input
combinations and verified that the statistics (score, multiplier, etc.) incremented correctly. We did this for all songs, which
allowed us to test our embedded system with differen JSONs. We also tested both single and multiplayer modes. For multiplayer mode,
we tested that the winner was displayed correctly based on each player's score. For the level editor, we tried creating JSONs
with a few arrows, many arrows, all arrows having the same direction, and all arrows having different directions.
Again, we tried creating levels for each of the possible songs. Lastly, we tested the leaderboard update process. We ensured that
a new score lower than all scores, a new score higher than all scores, and a new score in the middle of the previous scores could
all be added to the leaderboard.
Finally, we tested the software using the physical dance pad by just playing the game. We tested all songs and all features in
the same way that we described above.
We developed a fully functional rhythm game. It supports single player and multiplayer modes. It also has a level editor.
Future Work
Part | Cost |
---|---|
4'x8'x½” birch plywood | $48.86 |
2’x4’x⅛” hardboard (MDF) | $5.23 |
½”x¾”x10’ air conditioning foam | $1.98 |
50’ 18-2 gauge thermostat wire | $11.69 |
14 gauge 25’ red wire | $6.17 |
14 gauge 25’ black wire | $6.17 |
Construction adhesive | $7.98 |
Spray adhesive | $7.98 |
2’x4’x¼” MDF | $7.98 |
Gorilla duct tape | Had beforehand |
Aluminum foil | Had beforehand |
25’ LED strip (30 LED per meter) | Had beforehand |
Raspberry Pi | Lab component |
Electrical Wires | Lab component |
All of our code is located in this Github Repository.
Do it Again - Steve Aoki
Down with the Sickness - Disturbed
S.O.M.P. - Skratch'N Snyf
You Spin Me Round - Dead Or Alive